<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            background-color: #6CF;
            width: 200px;
            height: 200px;
        }
    </style>
</head>

<body>
    <div id="box">
    </div>
    <script>
        const oBox = document.getElementById('box')
        function throttle(fn,time) {
            let lastTime=0
            return function (e) {
                const nowTime=Date.now()
                if (nowTime-lastTime<100) {
                    return
                }
                lastTime=nowTime
                fn.call(this,e)
            }
        }
        function center() {
            console.log(1);
        }
        oBox.onmousemove = throttle(center, 100)
    </script>
</body>

</html>